﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using AiLuWeb.WebSite.Code;
using System.Collections;
using AiLuWeb.Model;
using AiLuWeb.Business;
using Ajeelee.Core.Utils;

namespace AiLuWeb.WebSite.WebAdmin
{
    public partial class SysModules : AuthPageBase
    {
        Hashtable table = new Hashtable();
        protected IList<SysModule> sysModuleList = new List<SysModule>();
        ISysModuleBusiness sysModuleBll = new SysModuleBusinessFactory().CreateSysModuleBusiness();

        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);
            try
            {
                table.Add(SysModuleHash.OrderField, "sort");
                table.Add(SysModuleHash.OrderDirection, "asc");
                // 删除
                if (!string.IsNullOrEmpty(QueryParam("d")))
                {
                    sysModuleBll.Delete(QueryParam("d"));
                    sysModuleBll.DeleteByPid(QueryParam("d"));
                }
                // 清空
                if (!string.IsNullOrEmpty(QueryParam("e")))
                {
                    sysModuleBll.DeleteByPid(QueryParam("e"));
                }

                sysModuleList = sysModuleBll.GetAllSysModule(table);
            }
            catch (Exception ex)
            {
                Function.WriteErrorLog(ex);
            }
        }
    }
}